<?php
header("Content-Type:text/html;charset=utf-8"); 
include '../dbConfig/mysqlFun.php';
$mysqlDB = new mysqlFun();
if(isset($_POST['truncateSubmit'])){
	if(isset($_POST['allSelectAction'])){
		if($_POST['allSelectAction']=="yes"){
			$errorTableName = $mysqlDB->truncateAllTable();
			$errorTableName = trim($errorTableName);
			if(!empty($errorTableName)){
				echo "删除表 ".$errorTableName." 出现问题";
			}else{
				echo "删除全部表数据成功！";
			}
		}else{
			if(isset($_POST['tableName'])&&!empty($_POST['tableName'])){
				$tableNameArray = $_POST['tableName'];
				$errorTableName = "";
				$okTableName = "";
				foreach($tableNameArray as $tableName){
					$okTableName .= $tableName."表数据,";
					$errorTableName .= $mysqlDB->truncateTableByName($tableName)." ";
				}
				$errorTableName = trim($errorTableName);
				if(!empty($errorTableName)){
					echo "删除表 ".$errorTableName." 出现问题";
				}else{
					echo $okTableName."删除成功！";
				}
			}
		}
	}
}
?>
<tr />
<a href="mysqlAllTable.php" alt="">返回</a>